package com.popcap.widgets;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Item
{
	Type type;
	String name;
	int id;
	Map<String, String> properties = new HashMap<String, String>();
	Map<String, String> methods = new HashMap<String, String>();
	List<Item> children = new ArrayList<Item>();

	public Item(int id, String name, Type type)
	{
		this.type = type;
		this.name = name;
		this.id = id;
	}

	public Type getType()
	{
		return type;
	}

	public void setType(Type type)
	{
		this.type = type;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public Map<String, String> getProperties()
	{
		return properties;
	}

	public void setProperty(String key, String value)
	{
		this.properties.put(key, value);
	}

	public String getMethod(String name)
	{
		return methods.get(name);
	}

	public void setMethod(String name, String target)
	{
		this.methods.put(name, target);
	}

	public List<Item> getChildren()
	{
		return children;
	}

	public void addChild(Item child)
	{
		this.children.add(child);
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}
}
